<template>
    <div v-if="htmlContent" class="modal-overlay">
      <div class="modal">
        <div class="modal-header">导出</div>
        <textarea class="textarea" v-model="htmlContent"></textarea>
        <div class="modal-footer">
          <button @click="closeModal">关闭</button>
        </div>
      </div>
    </div>
</template> 
  <script>
  import { event } from '../../uitls/event'
  import {ref} from 'vue'
  export default {
    setup(){
      const htmlContent = ref('')
      event.on('showPop', (content) => {
        htmlContent.value = content
      })
      const closeModal = () => {
        htmlContent.value = ''
      }
      return {
        htmlContent,
        closeModal
      }
    }
  };
  </script>
  
  <style scoped>
  .modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
  }
  
  .modal {
    background: white;
    padding: 20px;
    border-radius: 5px;
    width: 300px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  }
  
  .modal-header {
    display: flex;
    align-items: center;
    justify-content: center;
  }
  
  .close-button {
    background: none;
    border: none;
    font-size: 20px;
    cursor: pointer;
  }
  
  .modal-body {
    margin: 20px 0;
    border: 1px solid #ccc;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100px;
  }
  
  .modal-footer {
    display: flex;
    justify-content: center;
  }
  .textarea {
    resize: vertical; /* 允许垂直调整，但禁用水平调整 */
    width: 100%; /* 设置宽度为100% */
    height: 150px;
    font-size: 12px;
  }
  </style>